package terra.model.object.item;

import terra.definitions.item.WeaponDef;
import terra.model.Inventory;

public class WeaponItem extends WearItem {
	private static final long serialVersionUID = -8899590031280714102L;
	public static int TYPE_CLOSE = 0;
	public static int TYPE_RANGE = 1;
	public static int TYPE_SPELL = 2;
	public static int TYPE_SHIELD = 3;
	public int weaponType = 0;
	public int damage = 1;
	public int armor = 0;
	public int radius = 32;
	public float critRate = 1.5f;
	public float critChance = 0.01f;

	public WeaponItem(int objectId, WeaponDef def, Inventory inv) {
		super(objectId, def, inv);
		damage = def.damage;
		radius = def.radius;
		weaponType = def.type;
		armor = def.armor;
		critRate = def.getFloatProperty("critRate");
		critChance = def.getFloatProperty("critChance");
	}

}
